<% if(toBoolean(switchOffice!)){ %>
<li>
	<a href="javascript:" id="switchOffice">
		<i class="fa icon-grid" style="font-size:13px;"></i> ${officeName!}
	</a>
	<div class="hide"><#form:treeselect id="switchOfficeSelect" title="${text('部门切换')}" allowClear="true"
		url="${ctx}/sys/empUser/officeListData?isShowCode=true" callbackFuncName="switchOfficeSelectCallback"
		fieldNames="{'id':'officeCode','name':'fullName'}"/>
	</div>
	<script>
		$('#switchOffice').click(function(){
			$('#switchOfficeSelectButton').click();
		});
		function switchOfficeSelectCallback(id, act, index, layero, nodes){
			if (act == 'ok' || act == 'clear'){
				var officeCode = $('#switchOfficeSelectCode').val();
                js.ajaxSubmit("${ctx}/sys/empUser/switchOffice" + (officeCode != '' ? "/"+officeCode : ""), function(data){
                    js.showMessage(data.message);
                    js.window.location.reload();
                });
			}
		}
	</script>
</li>
<% } %>
